﻿using Autodesk.Revit.UI;
//using GalaSoft.MvvmLight;
//using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

//using SuperSqlOperation;
using System.Collections.ObjectModel;
using Prism.Mvvm;
using Prism.Commands;

namespace ProjectTest
{
    public partial class ProjectTestViewModel : BindableBase
    { 
        #region  一种即时实例化命令的方式
        //SelectEquipmentsCMD 绑定界面 SelectEquipmentsCMD命令
        public ICommand SelectEquipmentsCMD
        {
            get
            {
                return new DelegateCommand<object>(p =>
                {
                    SelectEquipmentsEXE();
                });
            }
        }

        private void SelectEquipmentsEXE()
        {

        }
        #endregion
         
        private void ActionEXE( )
        {
            TaskDialog.Show("SelectDeviceEXE", "无参数的 ");
            TEXT = "一般传递完成 ";
        } 
        private void Func01EXE(object obj)
        {
            TaskDialog.Show("SelectDeviceEXE", "带有一个参数的 ");
        }
        /// <summary>
        /// 带有其他参数的 并内置外部事件动作的
        /// </summary>
        /// <param name="vs"></param>
        private void Func02EXE(IList<object> vs)
        {
            TaskDialog.Show("SelectDeviceEXE", "带有其他参数的 并内置外部事件动作的 ");

            //创建动作
            Action<UIApplication> action01 = new Action<UIApplication>(app => EventAction01(app));
            //动作可以复合创建
            Action<UIApplication> actionX = new Action<UIApplication>(app => 
                {
                    EventAction01(app);
                    EventAction02(app, this); 
                }
            );
             
            //执行动作action02
            executeEventHandler.DelayRunAction(actionX);

        }

        // 事件具体操作函数 具体操作都在这里面
        private void EventAction01(UIApplication app)
        {
            TaskDialog.Show("eve01", "\n事件具体操作函数 具体操作都在这里面\n eve01-done\n ");
            TEXT =  "事件1 完成   eve01-done";
        }
        private void EventAction02(UIApplication app, ProjectTestViewModel VM)
        {
            TaskDialog.Show("eve02", "\n事件具体操作函数 具体操作都在这里面\n eve02-done\n ");
            TEXT = "事件2 完成 eve02-done";
        }
  
    }
}
